|
|
|
|
|
|
|
Figure C.12
The Query Builder makes it easy to build SQL statements. |
|
|
|
|
|
|
|
|
After you have set the Query Builder parameters, you can run the query, display the SQL statement, or copy the query to the SQL statement window. The Query Builder provides an easy way to become familiar with constructing SELECT queries. |
|
|
|
|
|
|
|
|
When you have developed the query to your satisfaction (either with the Query Builder or by typing the statement directly), you can save the query as a QueryDef in your database. In your Visual Basic code, you can then reference the name of the query you created. Alternatively, you can copy the query from Visual Data Manager and paste it into your application code. |
|
|
|
|
|
|
|
|
If you have a copy of Microsoft Access, you can use its query builder to graphically construct queries. You can then save the query as a QueryDef in the database and reference the query name in your Visual Basic code. |
|
|
|
|
|
|
|
|
One of more creative uses for Access is to reverse-engineer a QueryDef. Microsoft Access allows you to build a graphical representation of the tables and databases for a particular QueryDef entered in SQL format. This reverse-engineering process gives you a unique way to debug or make modifications graphically to an existing query. |
|
|
|
|
|
|
|
|
Optimizing SQL Performance |
|
|
|
|
|
|
|
|
Developers always want to get the best possible performance from every aspect of their applications. Wanting high performance out of SQL queries is no exception. Fortunately, there are several methods you can use to optimize the performance of your SQL queries. |
|
|
|
|
|